---
layout: "default"
title: "TextOutputStreamable"
description: "Swift documentation for 'TextOutputStreamable': A source of text-streaming operations."
keywords: "TextOutputStreamable,protocol,swift,documentation,write"
root: "/v3.0"
---

<div class="intro-declaration"><code class="language-swift">protocol TextOutputStreamable</code></div>

<div class="discussion comment">
    <p>A source of text-streaming operations.</p>

<p>Instances of types that conform to the <code>TextOutputStreamable</code> protocol can
write their value to instances of any type that conforms to the
<code>TextOutputStream</code> protocol. The Swift standard library&#39;s text-related
types, <code>String</code>, <code>Character</code>, and <code>UnicodeScalar</code>, all conform to
<code>TextOutputStreamable</code>.</p>

<h1>Conforming to the TextOutputStreamable Protocol</h1>

<p>To add <code>TextOutputStreamable</code> conformance to a custom type, implement the
required <code>write(to:)</code> method. Call the given output stream&#39;s <code>write(_:)</code>
method in your implementation.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>



<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>







<h3>Instance Methods</h3>
<div class="declaration" id="func-write-to_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-write-to_">func write(<wbr>to:)</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func-write-to_"><div class="p">
    <p>Writes a textual representation of this instance into the given output
stream.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func write&lt;Target : TextOutputStream&gt;(to target: inout Target)</code>
    
    
</div></div>
</div>


